
package Vista;

import Controlador.ControladorIdentificarCU1;
import DTO.ObjWorkDTO;
import DTO.ObjetivoDTO;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Point;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.io.IOException;
import java.util.Vector;
import javax.swing.DropMode;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.TransferHandler;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
/**
 *
 * @author Tapsin
 */
public class JPIdentificarCU1 extends javax.swing.JPanel {

    ControladorIdentificarCU1 control;
    DefaultTableModel tablaModel;
    public Vector nuevo = new Vector();
    public Vector rowTabla = new Vector();
    public Vector rowLista = new Vector();
    public Vector rowDato = new Vector();
    public Vector listObj = new Vector();
    public Vector listWork = new Vector();
    public String datos;
    /** Creates new form JPIdentificarCU1 */
    public JPIdentificarCU1(ControladorIdentificarCU1 controlador) {

/*41*/         this.control = controlador;
/*42*/         //carga los componentes y datos de la vista
/*43*/         initComponents();
/*44*/         this.cargarObjetivos();
/*45*/         //this.jButton1.setEnabled(false);
/*46*/         if (this.control.getListadoSA() == null) {
/*47*/             nuevo = this.cargarWorkflosSeparados();
/*48*/             this.listaWorkflow.setListData(nuevo);
/*49*/         } else {
/*50*/             //this.jButton1.setEnabled(true);
///*51*/             this.bContinuar.setEnabled(true);
/*52*/             this.setTablaWO(this.control.getListadoSA());
/*53*/             this.rowDato = this.control.rDato();
/*54*/             this.rowLista = this.control.rLista();
/*55*/             this.rowTabla = this.control.rTabla();
/*56*/             this.nuevo = this.control.nuevo();
/*57*/
/*58*/             this.cargarWorkflosSeparados();
/*59*/             this.listaWorkflow.setListData(nuevo);
/*60*/         }
/*61*/         this.listaWorkflow.setDragEnabled(true);
/*62*/         this.tablaObjWork.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
/*63*/         this.tablaObjWork.setDropMode(DropMode.ON);
/*64*/
/*65*/         //para utilizar el drag and drop en la tabla
/*66*/         this.tablaObjWork.setTransferHandler(new TransferHandler() {
/*67*/
/*68*/             @Override
/*69*/             public boolean canImport(TransferSupport support) {
/*70*/                 if (!support.isDrop()) {
/*71*/                     return false;
/*72*/                 }
/*73*/                 if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
/*74*/                     return false;
/*75*/                 }
/*76*/                 return true;
/*77*/             }
/*78*/
/*79*/             @Override
/*80*/             public boolean importData(TransferSupport support) {
                       String aux;                
/*81*/                 if (!canImport(support)) {
/*82*/                     return false;
/*83*/                 }
/*84*/                 //locaci�n
/*85*/                 JTable.DropLocation dl = (JTable.DropLocation) support.getDropLocation();
/*86*/                 int row = dl.getRow();
/*87*/                 String data;
/*88*/                 try {
/*89*/                     //el dato arrastrado
/*90*/                     data = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
/*91*/                    
/*92*/                 } catch (UnsupportedFlavorException e) {
/*93*/                     return false;
/*94*/                 } catch (IOException e) {
/*95*/                     return false;
/*96*/                 }
/*97*/                 //cuando no hay datos en la tabla
/*98*/                 if (tablaObjWork.getValueAt(row, 2) == null) {
                            aux = data;
                            aux= aux + "; ";
/*99*/                      tablaObjWork.setValueAt(aux, row, 2);
/*100*/                     rowTabla.add(row);
/*101*/                     rowLista.add(getListaWorkflow().getSelectedIndex());
/*102*/        /**/             rowDato.add(data);
/*103*/                     nuevo.remove(getListaWorkflow().getSelectedIndex());
/*104*/                     getListaWorkflow().setListData(nuevo);
                            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
/*105*/                     //jButton1.setEnabled(true);
/*106*/                     if (nuevo.isEmpty()) {
///*107*/                         bContinuar.setEnabled(true);
                                 control.valido = true; 
/*108*/                     }
/*109*/                 }// cuando hay elementos ya ingresados en la tabla
/*110*/                 else {
                            aux = data; 
                            aux= aux + "; ";
                            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
/*111*/                     tablaObjWork.setValueAt(tablaObjWork.getValueAt(row, 2) + aux, row, 2);
/*112*/                     //tablaObjWork.setValueAt(data, row, 1);
/*113*/                     rowTabla.add(row);
/*114*/                     rowLista.add(getListaWorkflow().getSelectedIndex());
/*115*/      /**/               rowDato.add(data);
/*116*/                     nuevo.remove(getListaWorkflow().getSelectedIndex());
/*117*/                     getListaWorkflow().setListData(nuevo);
/*118*/                     //jButton1.setEnabled(true);
/*119*/                     if (nuevo.isEmpty()) {
///*120*/                         bContinuar.setEnabled(true);
                                control.valido = true; 
/*121*/                     }
/*122*/                 }
/*123*/                 return true;
/*124*/             }
/*125*/         });
/*126*/         //para visualizar el contenido de una celda al pasar el mouse por ella
/*127*/         this.tablaObjWork.addMouseMotionListener(new MouseMotionAdapter() {
/*128*/
/*129*/             @Override
/*130*/             public void mouseMoved(MouseEvent e) {
/*131*/                 Point p = e.getPoint();
/*132*/                 int row = tablaObjWork.rowAtPoint(p);
/*133*/                 int column = tablaObjWork.columnAtPoint(p);
/*134*/                 tablaObjWork.setToolTipText(String.valueOf(tablaObjWork.getValueAt(row, column)));
/*135*/             }
/*136*/         });
/*137*/
    }
    
  /*140*/         /**
     * Asigna los objetivos a tableModel
     * no tiene entrada ni retorno
     */
/*143*/     public void cargarObjetivos() {
/*144*/         ObjetivoDTO objDTO = new ObjetivoDTO();
/*145*/         ObjWorkDTO objWork;
/*146*/         Vector ON = this.control.getNombreON();
/*147*/         this.setFilas(ON.size());
/*148*/         for (int i = 0; i < ON.size(); i++) {
/*149*/             objDTO = (ObjetivoDTO) ON.get(i);
/*150*/             this.tablaObjWork.setValueAt(objDTO.getNombre(), i, 1);
                    Integer intObj = new Integer(i+1);   //agrega el numero a la fila
                    this.tablaObjWork.setValueAt(intObj, i, 0);
/*151*/         }
/*152*/     }
/*153*/ 
/*154*/     //todos los workflows juntos
/*155*/         /**
     * Carga todos los workflows juntos
     * no posee entrada
     * @return Vetor con workflows
     */
/*159*/     public Vector cargarWorkflos() {
/*160*/         Vector workflows = new Vector();
/*161*/         workflows = this.control.getWorkflows();
/*162*/         return workflows;
/*163*/     }
/*164*/ 
/*165*/     //los ciclos separados
/*166*/     /**
     * Carga los workflows por separado
     * no posee entrada
     * @return  Vector con workflows
     */
/*170*/     public Vector cargarWorkflosSeparados() {
/*171*/         Vector workflows = new Vector();
/*172*/         workflows = this.control.getWorkflowsSeparados();
/*173*/         return workflows;
/*174*/     }
/*175*/ 
/*176*/     //seteo de propiedades de la tabla
/*177*/         /**
     * Seteo de propiedades de la tabla
     * @param tam de tipo int para generaci�n de la tabla
     */
/*181*/     public void setFilas(int tam) {
/*182*/ 
/*183*/         DefaultTableModel tabla = new MyTableModel(new Object[][]{},
/*184*/                 new String[]{
/*185*/                     "Número","Nombre Objetivo", "Workflow Asociado"
/*186*/                 });
/*187*/         tabla.setRowCount(tam);
/*188*/         tabla.setColumnCount(3);
/*189*/         tablaObjWork.setModel(tabla);
/*190*/         this.tablaObjWork.getColumnModel().getColumn(2).setCellRenderer(new TextAreaRenderer());
/*191*/         tablaObjWork.setShowGrid(true);
/*192*/         tablaObjWork.setGridColor(Color.black);
                TableColumn col= tablaObjWork.getColumn("Número");
                col.setMaxWidth(50);
/*193*/     }

    public void alerta(String mensaje) {
        JOptionPane.showMessageDialog(null, mensaje, "Identificar Casos de Uso", JOptionPane.WARNING_MESSAGE);
    }

    /**
     * @return the listaWorkflow
     */
    public javax.swing.JList getListaWorkflow() {
        return listaWorkflow;
    }

    /**
     * @param listaWorkflow the listaWorkflow to set
     */
    public void setListaWorkflow(javax.swing.JList listaWorkflow) {
        this.listaWorkflow = listaWorkflow;
    }
/*194*/ 
/*195*/     //seteo de propiedades de la tabla
/*196*/         /**
     * clase para generar tabla
     */
/*199*/     class MyTableModel extends DefaultTableModel {
/*200*/ 
/*201*/         /**
                 *
                 * @param data
                 * @param columnNames
                 */
/*206*/         public MyTableModel(Object[][] data, Object[] columnNames) {
/*207*/             super(data, columnNames);
/*208*/         }
/*209*/ 
/*210*/             /**
     * El m�todo esblece la posibilidad de edici�n de la tabla
     * @param row filas de la tabla
     * @param col columnas de la tabla
     * @return valor booleano true o false
     */ 
/*216*/         @Override
/*217*/         public boolean isCellEditable(int row, int col) {
/*218*/             if (col == 0 || col == 1 || col == 2 ) {
/*219*/                 return false;
/*220*/             } else {
/*221*/                 return true;
/*222*/             }
/*223*/         }
/*224*/     }
/*225*/ 
/*226*/     //seteo del listado de workflows por objetivos asignados
/*227*/            /**
    * El m�todo asigna los workflows a los objetivos
    * @return Vector de workflows
    */
/*231*/     public Vector setObjWork() {
/*232*/         Vector ON = this.control.getNombreON();
/*233*/         Vector listObjWork = new Vector();
/*234*/         for (int i = 0; i < ON.size(); i++) {
/*235*/             listObjWork.add(this.tablaObjWork.getValueAt(i, 2));
/*236*/         }
/*237*/         return listObjWork;
/*238*/     }
/*239*/ 
/*240*/            /**
     *
     * @return Vector con workflows objetivos
     */
/*244*/     public Vector setWorkXObj() {
/*245*/         Vector ON = this.control.getNombreON();
/*246*/         int cont = 0;
/*247*/         Vector listWorkflowXObjetivo = new Vector();
/*248*/         Vector workflow;
/*249*/         for (int i = 0; i < ON.size(); i++) {
/*250*/             workflow = new Vector();
/*251*/             for (int j = 0; j < this.rowTabla.size(); j++) {
/*252*/                 if (Integer.parseInt(this.rowTabla.get(j).toString()) == i) {
/*253*/                     workflow.add(this.rowDato.get(j));
/*254*/                 }
/*255*/             }
/*256*/             listWorkflowXObjetivo.add(workflow);
/*257*/         }
/*258*/         return listWorkflowXObjetivo;
/*259*/     }
/*260*/ 
/*261*/     //obtiene los datos de la tabla
/*262*/         /**
     * Obtiene los valores de los elementos de la tabla
     * @return Vector con los elementos de la lista
     */
/*266*/     public Vector getDatosTabla() {
/*267*/         Vector listadoSA = new Vector();
/*268*/         for (int i = 0; i < this.tablaObjWork.getRowCount(); i++) {
/*269*/             listadoSA.add(this.tablaObjWork.getValueAt(i, 2));
/*270*/         }
/*271*/         return listadoSA;
/*272*/     }
/*273*/ 
/*274*/     //setea los valores en la tabla
/*275*/         /**
     * Setea los valores de los elementos de la tabla
     * @param list setea los workflows en la tabla con su correspondiente objetivo
     */
/*279*/     public void setTablaWO(Vector list) {
/*280*/         for (int i = 0; i < list.size(); i++) {
/*281*/             this.tablaObjWork.setValueAt(list.get(i), i, 2);
                    Integer intObj = new Integer(i+1);   //agrega el numero a la fila
                    this.tablaObjWork.setValueAt(intObj, i, 0);
/*282*/         }
/*283*/     }




    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaObjWork = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        listaWorkflow = new javax.swing.JList();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();

        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(proyectodetitulo.ProyectoDeTituloApp.class).getContext().getResourceMap(JPIdentificarCU1.class);
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tablaObjWork.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Número", "Nombre Objetivo", "Workflow Asociado"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tablaObjWork.setCellSelectionEnabled(true);
        tablaObjWork.setDragEnabled(true);
        tablaObjWork.setName("tablaObjWork"); // NOI18N
        tablaObjWork.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tablaObjWorkMouseEntered(evt);
            }
        });
        tablaObjWork.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                tablaObjWorkMouseDragged(evt);
            }
        });
        jScrollPane1.setViewportView(tablaObjWork);
        tablaObjWork.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        tablaObjWork.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tablaObjWork.columnModel.title2")); // NOI18N
        tablaObjWork.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tablaObjWork.columnModel.title0")); // NOI18N
        tablaObjWork.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tablaObjWork.columnModel.title1")); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        listaWorkflow.setName("listaWorkflow"); // NOI18N
        listaWorkflow.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                listaWorkflowMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                listaWorkflowMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                listaWorkflowMouseReleased(evt);
            }
        });
        listaWorkflow.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                listaWorkflowMouseDragged(evt);
            }
        });
        jScrollPane2.setViewportView(listaWorkflow);

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setIcon(resourceMap.getIcon("jLabel5.icon")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel4)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 637, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel6))))
                        .addGap(71, 71, 71)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addGap(76, 76, 76)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel5)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel7)))
                .addContainerGap(170, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void tablaObjWorkMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaObjWorkMouseDragged
        /*700*/         // TODO add your handling code here:
}//GEN-LAST:event_tablaObjWorkMouseDragged

    private void listaWorkflowMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaWorkflowMouseDragged
        /*708*/         // TODO add your handling code here:
}//GEN-LAST:event_listaWorkflowMouseDragged

    /*Mientras el mouse esté presionado desde la ventana listaWorkflow el cursor sera una mano*/
private void listaWorkflowMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaWorkflowMousePressed
    setCursor(new Cursor(Cursor.HAND_CURSOR));
}//GEN-LAST:event_listaWorkflowMousePressed

private void tablaObjWorkMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaObjWorkMouseEntered
}//GEN-LAST:event_tablaObjWorkMouseEntered

private void listaWorkflowMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaWorkflowMouseExited
}//GEN-LAST:event_listaWorkflowMouseExited

private void listaWorkflowMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaWorkflowMouseReleased
    
}//GEN-LAST:event_listaWorkflowMouseReleased
 public void deshacer(){
     int t = Integer.parseInt(this.rowTabla.lastElement().toString());
/*732*/         this.rowTabla.remove(this.rowTabla.size() - 1);
/*733*/         if (this.tablaObjWork.getValueAt(t, 2).toString().equals(this.rowDato.lastElement().toString())) {
/*734*/             this.tablaObjWork.setValueAt(null, t, 2);
/*735*/         } else {
/*736*/             String nuevoDato = this.tablaObjWork.getValueAt(t, 2).toString().substring(0, this.tablaObjWork.getValueAt(t, 2).toString().length() - (this.rowDato.lastElement().toString().length()+2));
                    this.tablaObjWork.setValueAt(nuevoDato, t, 2);
/*738*/         }
/*739*/         int l = Integer.parseInt(this.rowLista.lastElement().toString());
                this.rowLista.remove(this.rowLista.size() - 1);
/*741*/         this.nuevo.add(l, this.rowDato.lastElement());
/*742*/         this.rowDato.remove(this.rowDato.size() - 1);
/*743*/         this.listaWorkflow.setListData(nuevo);
/*744*/        //if ((rowTabla.isEmpty()) && (rowLista.isEmpty()) && (rowDato.isEmpty())) {
/*745*/            //jButton1.setEnabled(false);
/*746*/        //}
 }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JList listaWorkflow;
    private javax.swing.JTable tablaObjWork;
    // End of variables declaration//GEN-END:variables
    
    
}
